#ifndef LISTITEM_H
#define LISTITEM_H

#include <QWidget>
#include <QDebug>
#include <QMenu>
#include "mlabel.h"

namespace Ui {
class ListItem;
}

class ListItem : public QWidget
{
    Q_OBJECT

public:
    explicit ListItem(QWidget *parent = nullptr);
    ~ListItem();

    void enterEvent(QEvent *event);

    void leaveEvent(QEvent *event);

    //void mousePressEvent(QMouseEvent *event);

    void setMusicNameLabel(const QString& musicName);
    void setSingerNameLabel(const QString& singerName);
    void setCoverNameLabel(const QString&coverName);
    void setIsLike(bool isLike);
    void setMusicId(QString musicId);

    QPoint topRightPoint();
private slots:
    void on_likeBt_clicked();
    void on_moreBt_clicked();
//    void onItemPlayClick();
//    void onItemNextClick();
//    void onItemDeleteClick();
//    void onItemCommendClick();
    //bool eventFilter(QObject *watched, QEvent *event);
signals:
    void isLikeClick(bool);
    void moreBtClick(QMenu*,int,int);
    void itemPlayClick(const QString& musicId);
    void itemNextClick(const QString& musicId);
    void itemDeleteClick(const QString& musicId);
    void itemCommendClick(const QString& musicId);

private:
    Ui::ListItem *ui;
    bool isLike;
    QMenu* menu;
    QString musicId;
};

#endif // LISTITEM_H
